package com.suse.lhw.hms.foodserver.controller;

import com.suse.lhw.hms.foodserver.domin.FFoodmodel;
import com.suse.lhw.hms.foodserver.service.FFoodmodelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ProjectName: health_manage_system
 * @Package: com.suse.lhw.hms.foodserver.com.suse.lhw.security.controller
 * @ClassName: TestController
 * @Description: java类作用描述
 * @Author: 李鸿炜
 * @CreateDate: 2020/4/18 19:32
 * @UpdateUser: 更新者
 * @UpdateDate: 2020/4/18 19:32
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@RestController
@RequestMapping("food/manager")
public class TestController {
    @Autowired
    FFoodmodelService fFoodmodelService;

    @PostMapping("addFoodModel")
    public String addFoodModel(int satus, int fm_category, String Imgurl,
                               int fmsg_id, String descroption
    ) {
        /**
         * @Author:Hongwei Li
         * @Description:添加一个model类
         * @Date:22:14 2020/4/21
         * @Param:[satus, fm_category, Imgurl, fmsg_id, descroption]
         * @Return:java.lang.String
         **/
        FFoodmodel fFoodmodel = new FFoodmodel(satus, fm_category, Imgurl, fmsg_id, descroption);
        System.out.println(fFoodmodel);
        int resutl = fFoodmodelService.insertSelective(fFoodmodel);
        System.out.println(resutl);
        return null;
    }

    @GetMapping("selectAfoodmodelById")
    public String selectAfoodModelByuId(int id) {
        return fFoodmodelService.selectByPrimaryKey(id).toString();
    }
}
